<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<link rel="stylesheet"
	href="<c:url value="/resources/lib/bootstrap-3.3.5/css/bootstrap.min.css"/>" />
	<link href="/resources/lib/font-awesome-4.4.0/css/font-awesome.min.css"
	rel="stylesheet" type="text/css" />
	<link href="/resources/lib/font-awesome-4.4.0/css/font-awesome.min.css"
	rel="stylesheet" type="text/css" />
		
<link href="/resources/css/header.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet"href="<c:url value="/resources/css/common.css"/>" />
<link rel="stylesheet"
	href="<c:url value="/resources/css/task/task.css"/>" />
<script src="<c:url value="/resources/lib/jquery-2.1.4.min.js" />"
	type="text/javascript"></script>
<script
	src="<c:url value="/resources/lib/bootstrap-3.3.5/js/bootstrap.min.js" />"
	type="text/javascript"></script>

<script
	src="<c:url value="/resources/lib/angular-1.4.7/angular.min.js"/>"
	type="text/javascript">
	
</script>
<script
	src="<c:url value="/resources/lib/ui-bootstrap-tpls-0.13.4.min.js"/>"
	type="text/javascript">
	
</script>
<script src="<c:url value="/resources/js/task/task.js" />"
	type="text/javascript"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>task</title>
</head>
<body ng-app="conversionTool">
<ng-include src="'/resources/viewPart/nav.html'" >
	
	</ng-include>
	<header>
	<div class="head-line">
		<h3 class="head-title">Task</h3>
		</div>
	</header>

	<section class="container" ng-controller="taskCtrl as task">

		<form role="form" enctype="multipart/form-data" method="post"
			action="${csvFileUpload}" class="form-horizontal text-center">

			<!-- initial -->

			<div ng-init="csvUploadUrl='${csvFileUpload}'"></div>

			<input type="hidden" name="taskFlowId" value="${taskFlow.id}" /> <input
				type="hidden" name="id" value="${task.id}" />


			<div class="form-group text-center form-line">
               <div class="col-xs-4 text-right">
				<label>Task Name</label> 
				</div>
				
				<div class="col-xs-8">
				<input type="text" class="form-control"
					id="taskName" name="taskName" />
			</div>
			</div>



			<div class="form-group text-center form-line">
			<div class="col-xs-4 text-right">
				<label>Choose A Project</label>
				</div>
				<div class="col-xs-8"></div>
           </div>
           <div class="form-group text-center form-line">
           <div class="col-xs-4 text-right"></div>
			<div class="col-xs-8">
				<div ng-init="projectId='${projectId}'"></div>

				<table class="table table-bordered">
					<thead>
						<tr>
							<th></th>
							<th>project name</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${projects}" var="item">
							<tr>
								<td>
								<input type="checkbox"
									ng-click="setProjectId(${item.id})"
									ng-checked="${item.id}==projectId" /></td>
									
								<td>${item.projectName}</td>
								
							</tr>
						</c:forEach>

					</tbody>
				</table>
			</div>
			</div>


			 <div class="form-group text-center form-line">
			 <div class="col-xs-4 text-right">
				<label>Choose Operation</label>
				</div>
				<div class="col-xs-8"></div>
				</DIV>
				
				 <div class="form-group text-center form-line">
				  <div class="col-xs-4 text-right"></div>
				<div class="col-xs-8">
				<div ng-init="operationId='${operationId}'"></div>
				<input type="hidden" name="operationId" value="{{operationId}}" />
				<table class="table table-bordered">
					<thead>
						<tr>
							<th></th>
							<th>operation name</th>
							<th>type</th>
						</tr>
					</thead>
					<tbody>
						<tr ng-repeat="item in operations">
							<td><input type="checkbox" ng-click="setOperation(item.id)"
								ng-checked="item.id==operationId"></td>
							<th>{{item.operationName}}</th>
							<th>{{item.dataAdaptorData.dataType}}</th>
						</tr>
					</tbody>
				</table>
			</div>
			</div>



			<div class="form-group text-center form-line" ng-show="showUpload">
			    <div class="col-xs-4 text-right">
				<label>Upload Source File</label> 
				</div>
				<div class="col-xs-8">
				<input type="file"
					class="form-control " name="file" id="file" multiple="multiple"
					accept=".csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
			</div>
			</div>

			<div class="form-group text-center form-line">
               <div class="col-xs-4 text-right">
				<label>Error Path</label>
				</div>
				 <div class="col-xs-8">
				<input type="text" class="form-control"
					name="errorPath" /> 
					</div>
					
					
					<!--  <label>error value:</label> <input type="text"
					class="form-control" name="errorValue" />-->

			</div>
			
			<div class="form-group text-center form-line">
               <div class="col-xs-4 text-right">
				<label>Error Value</label> 
				</div>
				 <div class="col-xs-8">
				<input type="text"
					class="form-control" name="errorValue" />

					</div>
					</div>
			



			<div class="form-group text-center form-line">
    <div class="col-xs-4 text-right"></div>
    
     <div class="col-xs-8 text-right">
				<input type="submit" value="Save" class="btn btn-primary"
					ng-click="save()" />
			</div>
			</div>
		</form>


		<div class="col-md-12 text-center form-group">{{msg}}</div>

	</section>



</body>
</html>
